package com.smartcampusbackend.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.smartcampusbackend.model.SystemLog;
import java.util.List;
import java.util.Map;

public interface SystemLogService {
    
    /**
     * 记录日志
     */
    void log(SystemLog systemLog);
    
    /**
     * 记录登录日志
     */
    void logLogin(String username, Integer userId, String ipAddress, String userAgent, String status, String description);
    
    /**
     * 记录操作日志
     */
    void logOperation(String username, Integer userId, String action, String description, String ipAddress, String userAgent, String requestUrl, String requestMethod, String requestParams, Integer responseStatus, Long executionTime, String status);
    
    /**
     * 记录数据操作日志
     */
    void logData(String username, Integer userId, String action, String description, String ipAddress, String userAgent, String requestUrl, String requestMethod, String requestParams, Integer responseStatus, Long executionTime, String status);
    
    /**
     * 记录错误日志
     */
    void logError(String username, Integer userId, String action, String description, String ipAddress, String userAgent, String requestUrl, String requestMethod, String requestParams, Integer responseStatus, String errorMessage, Long executionTime);
    
    /**
     * 分页查询日志
     */
    IPage<SystemLog> getLogsByPage(Page<SystemLog> page, String username, String logType, String status, String startDate, String endDate);
    
    /**
     * 获取今日统计
     */
    Map<String, Object> getTodayStats();
    
    /**
     * 获取用户最近日志
     */
    List<SystemLog> getRecentLogsByUsername(String username, int limit);
    
    /**
     * 获取时间范围统计
     */
    List<Map<String, Object>> getLogStatsByDateRange(String startDate, String endDate);
    
    /**
     * 导出日志
     */
    byte[] exportLogs(String username, String logType, String status, String startDate, String endDate);
    
    /**
     * 导出PDF日志
     */
    byte[] exportLogsPDF(String username, String logType, String status, String startDate, String endDate);
} 